﻿#pragma once

#include "Libraries/ISoundLibrary.h"
#include <string>
#include <unordered_map>
#include <vector>
#include "../../stringhelper.h"
#include "../../tangible_filesystem.h"

using namespace SlimDX::DirectSound;

namespace Client::MirSounds
{
    class SoundManager final
    {
    public:
        static DirectSound *Device;
    private:
//C# TO C++ CONVERTER WARNING: C++ has no equivalent to a 'readonly' collection which allows modification of internal state:
//ORIGINAL LINE: private static readonly List<ISoundLibrary> Sounds = new List<ISoundLibrary>();
        static std::vector<ISoundLibrary*> Sounds;
//C# TO C++ CONVERTER WARNING: C++ has no equivalent to a 'readonly' collection which allows modification of internal state:
//ORIGINAL LINE: private static readonly Dictionary<int, string> IndexList = new Dictionary<int, string>();
        static std::unordered_map<int, std::string> IndexList;

    public:
        static ISoundLibrary *Music;

    private:
        static int _vol;
    public:
        static int getVol();
        static void setVol(int value);

    private:
        static int _musicVol;
    public:
        static int getMusicVol();
        static void setMusicVol(int value);

        static void Create();
        static void LoadSoundList();


        static void StopSound(int index);

        static void PlaySound(int index, bool loop = false);

        static void PlayMusic(int index, bool loop = false);

    private:
        static void AdjustAllVolumes();

        static ISoundLibrary *GetSound(int index, const std::string &fileName, bool loop);
    };

    class SoundList final
    {
    public:
        static int None;
        static int Music;
        static int IntroMusic;
        static int SelectMusic;
        static int LoginEffect;
        static int ButtonA;
        static int ButtonB;
        static int ButtonC;
        static int Gold;
        static int EatDrug;
        static int ClickDrug;
        static int Teleport;
        static int LevelUp;
        static int ClickWeapon;
        static int ClickArmour;
        static int ClickRing;
        static int ClickBracelet;
        static int ClickNecklace;
        static int ClickHelmet;
        static int ClickBoots;
        static int ClickItem;
        static int WalkGroundL;
        static int WalkGroundR;
        static int RunGroundL;
        static int RunGroundR;
        static int WalkStoneL;
        static int WalkStoneR;
        static int RunStoneL;
        static int RunStoneR;
        static int WalkLawnL;
        static int WalkLawnR;
        static int RunLawnL;
        static int RunLawnR;
        static int WalkRoughL;
        static int WalkRoughR;
        static int RunRoughL;
        static int RunRoughR;
        static int WalkWoodL;
        static int WalkWoodR;
        static int RunWoodL;
        static int RunWoodR;
        static int WalkCaveL;
        static int WalkCaveR;
        static int RunCaveL;
        static int RunCaveR;
        static int WalkRoomL;
        static int WalkRoomR;
        static int RunRoomL;
        static int RunRoomR;
        static int WalkWaterL;
        static int WalkWaterR;
        static int RunWaterL;
        static int RunWaterR;
        static int HorseWalkL;
        static int HorseWalkR;
        static int HorseRun;
        static int WalkSnowL;
        static int WalkSnowR;
        static int RunSnowL;
        static int RunSnowR;
        static int SwingShort;
        static int SwingWood;
        static int SwingSword;
        static int SwingSword2;
        static int SwingAxe;
        static int SwingClub;
        static int SwingLong;
        static int SwingFist;
        static int StruckShort;
        static int StruckWooden;
        static int StruckSword;
        static int StruckSword2;
        static int StruckAxe;
        static int StruckClub;
        static int StruckBodySword;
        static int StruckBodyAxe;
        static int StruckBodyLongStick;
        static int StruckBodyFist;
        static int StruckArmourSword;
        static int StruckArmourAxe;
        static int StruckArmourLongStick;
        static int StruckArmourFist;
        static int MaleFlinch;
        static int FemaleFlinch;
        static int MaleDie;
        static int FemaleDie;
        static int Revive;
        static int ZombieRevive;
        static int MountWalkL;
        static int MountWalkR;
        static int MountRun;
        static int TigerStruck1;
        static int TigerStruck2;
        static int TigerAttack1;
        static int TigerAttack2;
        static int TigerAttack3;
        static int FishingThrow;
        static int FishingPull;
        static int Fishing;
        static int WolfRide1;
        static int WolfRide2;
        static int WolfAttack1;
        static int WolfAttack2;
        static int WolfAttack3;
        static int WolfStruck1;
        static int WolfStruck2;
        static int TigerRide1;
        static int TigerRide2;
        static int PetPig;
        static int PetChick;
        static int PetKitty;
        static int PetSkeleton;
        static int PetPigman;
        static int PetWemade;
        static int PetBlackKitten;
        static int PetDragon;
        static int PetOlympic;
        static int PetFrog;
        static int PetMonkey;
        static int PetAngryBird;
        static int PetFoxey;
        static int PetMedicalRat;
        static int PetPickup;
    };
}
